<template>
	<view class="container">
		<view class="yy-su-head">
			<view class="yy-su-headtitle">
				<view class="yy-su-headtitleImg">
					<image v-if="status == 0" src="../../static/icon_daijiezhen.png" mode="widthFix"></image>
					<image v-else src="../../static/icon_suss.png" mode="widthFix"></image>
				</view>
				<text v-if="status == 0">待接诊</text>
				<text  v-else>已接诊</text>
			</view>
			<text v-if="status == 0" class="yy-su-headtip">请在预约时间前接诊</text>
			<text v-else class="yy-su-headtip">{{patientdetail.make_time}}</text>
		</view>
		<view class="yy-su-navhead">
			<view class="yy-su-navhead-bg"></view>
		</view>
		<view class="yy-su-con">
			<view class="yy-su-con-t">
				<view class="yy-su-con-title">
					<view class="line"></view>
					<text>预约号</text>
					<view class="line"></view>
				</view>
				<view class="yy-su-con-num">
					<text>{{patientdetail.code}}</text>
				</view>
				<view class="yy-su-con-list">
					<view class="yy-su-con-item">
						<text>候诊时间</text>
						<text class="yy-su-con-Sitem">{{patientdetail.make_time}}</text>
					</view>
					<view class="yy-su-con-item">
						<text>就诊人</text>
						<text>{{patientdetail.user_member_name}}</text>
					</view>
					<view class="yy-su-con-item">
						<text>年龄</text>
						<text>{{patientdetail.user_member_age}}岁</text>
					</view>
					<view class="yy-su-con-item">
						<text>手机号</text>
						<text>{{patientdetail.user_member_mobile}}</text>
					</view>
					<view class="yy-su-con-item">
						<text>身份证号</text>
						<text>{{patientdetail.user_member_id_no}}</text>
					</view>
				</view>
			</view>
			<view class="yy-su-con-t yy-su-con-tItem">
				<view class="yy-su-con-list">
					<view class="yy-su-con-item">
						<text>就诊医院</text>
						<text>{{patientdetail.hospital_name}}</text>
					</view>
					<view class="yy-su-con-item">
						<text>就诊科室</text>
						<text>{{patientdetail.department_name}}</text>
					</view>
					<view class="yy-su-con-item">
						<text>就诊医生</text>
						<text>{{patientdetail.nickname}}</text>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import app from '../../App.vue'
	export default{
		data(){
			return{
				status:'',
				patientid:'',
				patientdetail:''
			}
		},
		onLoad(options) {
			this.status = options.status
			this.patientid = options.id
		},
		onShow() {
			this.getstatus()
		},
		methods:{
			getstatus(){
				let that = this,
				data = {
					order_id:that.patientid
				}
				app.post('api/order/orderInfo',data).then(res=>{
					if(res.code == 1){
						console.log(res)
						that.patientdetail = res.data
					}else{
						uni.showToast({
							title: res.msg,
							icon: 'none',
							mask: true
						})
					}
				}).catch(err=>{
					uni.showToast({
						title: res.msg,
						icon: 'none',
						mask: true
					})
				})
			}
		}
	}
</script>

<style>
	@import url("../../common/docyuyue.css");
</style>
